package com.tom.jmgd.controller;

import com.baomidou.dynamic.datasource.annotation.DS;
import com.tom.jmgd.core.entity.ResultEntity;
import com.tom.jmgd.core.enums.ResultEnum;
//import com.tom.jmgd.dao.ProcOracleMapper;
import com.tom.jmgd.entity.param.SyncBaseDataJm;
import com.tom.jmgd.entity.param.SyncVencusJm;
import com.tom.jmgd.entity.param.SyncWareJm;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestParam;
import org.springframework.web.bind.annotation.RestController;

import java.util.ArrayList;
import java.util.List;
import java.util.Map;

@RestController
@RequestMapping("/procController")
public class ProcController {
   /* @Autowired
    ProcOracleMapper procOracleMapper;

    @RequestMapping("/syncJMGDware")
    public ResultEntity syncJMGDware(@RequestParam(value = "wareCodes") String wareCodes) {
        SyncWareJm syncWareJm = new SyncWareJm();
        syncWareJm.setSyncEndDate(null);
        syncWareJm.setSyncType("C");
        syncWareJm.setWareCodes(wareCodes);
        procOracleMapper.syncWare(syncWareJm);
        return new ResultEntity(ResultEnum.SAVE_SUCCESS,wareCodes+"同步成功");
    }

    @RequestMapping("/syncJMGDvencus")
    public ResultEntity syncJMGDvencus(@RequestParam(value = "vencusCodes") String vencusCodes) {
        SyncVencusJm syncVencusJm = new SyncVencusJm();
        syncVencusJm.setSyncEndDate(null);
        syncVencusJm.setSyncType("C");
        syncVencusJm.setVencusCodes(vencusCodes);
        procOracleMapper.syncVencus(syncVencusJm);
        return new ResultEntity(ResultEnum.SAVE_SUCCESS,vencusCodes+"同步成功");
    }

    @RequestMapping("/syncJMGDFactory")
    public ResultEntity syncJMGDFactory() {
        SyncBaseDataJm syncBaseDataJm = new SyncBaseDataJm();
        procOracleMapper.syncBaseData(syncBaseDataJm);
        return new ResultEntity(ResultEnum.SAVE_SUCCESS,null);
    }

    @DS("h2")
    @RequestMapping("/testQuery")
    public ResultEntity testQuery() {
        Map map = procOracleMapper.testQuery();
        return new ResultEntity(ResultEnum.SAVE_SUCCESS,map);
    }

    @RequestMapping("/testQuerySql")
    public ResultEntity testQuerySql() {
        Map map = procOracleMapper.testQuerySql();
        return new ResultEntity(ResultEnum.SAVE_SUCCESS,map);
    }*/
}
